import type { RouterConfig } from "@nuxt/schema";

export default {
  // https://router.vuejs.org/api/interfaces/routeroptions.html#routes
  routes: (_routes) => [
    {
      name: "home",
      path: "/",
      component: () => import("~/pages/custom.vue"),
    },
    {
      name: "about",
      path: "/about",
      component: () => import("~/pages/about.vue"),
    },
    {
      name: "blog",
      path: "/blog",
      component: () => import("~/pages/blog/index.vue"),
    },
    {
      name: "blog-detail",
      path: "/blog/:id",
      component: () => import("~/pages/blog/[id].vue"),
    },
    {
      path: "/:pathMatch(.*)*", // 捕获所有未匹配的路由
      name: "not-found",
      component: () => import("~/pages/404.vue"),
    },
  ],
} satisfies RouterConfig;
